package com.weixin.paleituo.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 购物车收货人信息bean
 *
 * @author fengzhen
 * @version 1.0, 2018/3/28
 */
public class ShippingAddressBean implements Parcelable {

    /**
     * id : 10
     * contact : 张三
     * phone : 18355555555
     * address : 四川省成都市高新区 啦啦啦啦
     * userId : 41
     * isdefault : 1
     * "provinsId": 510000,
     * "cityId": 510100,
     * "districtId": 510170,
     * "provinsName": "四川省",
     * "cityName": "成都市",
     * "districtName": "高新区",
     * "detailAddress": "四川省成都市高新区 默默",
     */
    private int id;
    private String contact;
    private String phone;
    private String address;
    private String provinsName;
    private String cityName;
    private String districtName;
    private String detailAddress;
    private int provinsId;
    private int cityId;
    private int districtId;
    private int userId;
    private int isdefault;

    protected ShippingAddressBean(Parcel in) {
        id = in.readInt();
        contact = in.readString();
        phone = in.readString();
        address = in.readString();
        provinsName = in.readString();
        cityName = in.readString();
        districtName = in.readString();
        detailAddress = in.readString();
        provinsId = in.readInt();
        cityId = in.readInt();
        districtId = in.readInt();
        userId = in.readInt();
        isdefault = in.readInt();
    }

    public static final Creator<ShippingAddressBean> CREATOR = new Creator<ShippingAddressBean>() {
        @Override
        public ShippingAddressBean createFromParcel(Parcel in) {
            return new ShippingAddressBean(in);
        }

        @Override
        public ShippingAddressBean[] newArray(int size) {
            return new ShippingAddressBean[size];
        }
    };

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getContact() {
        return contact;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getProvinsName() {
        return provinsName;
    }

    public void setProvinsName(String provinsName) {
        this.provinsName = provinsName;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getDistrictName() {
        return districtName;
    }

    public void setDistrictName(String districtName) {
        this.districtName = districtName;
    }

    public String getDetailAddress() {
        return detailAddress;
    }

    public void setDetailAddress(String detailAddress) {
        this.detailAddress = detailAddress;
    }

    public int getProvinsId() {
        return provinsId;
    }

    public void setProvinsId(int provinsId) {
        this.provinsId = provinsId;
    }

    public int getCityId() {
        return cityId;
    }

    public void setCityId(int cityId) {
        this.cityId = cityId;
    }

    public int getDistrictId() {
        return districtId;
    }

    public void setDistrictId(int districtId) {
        this.districtId = districtId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public boolean isdefault() {
        return isdefault == 2;
    }

    public void setIsdefault(int isdefault) {
        this.isdefault = isdefault;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(contact);
        dest.writeString(phone);
        dest.writeString(address);
        dest.writeString(provinsName);
        dest.writeString(cityName);
        dest.writeString(districtName);
        dest.writeString(detailAddress);
        dest.writeInt(provinsId);
        dest.writeInt(cityId);
        dest.writeInt(districtId);
        dest.writeInt(userId);
        dest.writeInt(isdefault);
    }
}
